// Widgets/User/UserPetWidget/UserPetWidget.js
//获取应用实例
const app = getApp();
const assetsAddress = app.globalData.global.assetsIp + '/' + app.globalData.global.assetsName;
Component({

  /**
   * 组件的属性列表
   */
  properties: {
    petList: {
      type: Array,
      value: [],
    },
  },

  /**
   * 组件的初始数据
   */
  data: {
    assetsAddress: assetsAddress,
    current: 0,
  },

  /**
   * 组件的方法列表
   */
  methods: {
    // 添加宠物
    addPet(){
      wx.navigateTo({
        url: '/pages/Users/AddPet/AddPet',
      })
    },
    // 宠物健康信息
    goHealth(e){
      const item = e.target.dataset.item||e.currentTarget.dataset.item;
      wx.navigateTo({
        url: `/pages/Pet/PetHealthInfo/PetHealthInfo?petId=${item.id}`,
      })
    }
  }
})